﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cofe.Core;
using System.Threading;

namespace Cofe.Core.Logger
{
    public interface IEventHub : ICofeService
    {
        IEventListener<T> SpawnListener<T>(Action<IEnumerable<IEventLog<T>>> handleAction, CancellationToken token) where T : EventArgs;
        void RegisterEventListener(IEventListener listener);
        void RegisterEventListener<T>(IEventListener<T> listener) where T : EventArgs;        
        void DispatchEvent<T>(object sender, T args) where T : EventArgs;        
        void RegisterEventSource<T>(IEventSource<T> source) where T : EventArgs;
        void RegisterEventSource(IEventSource source);

        IEventSource<ErrorEventArgs> ErrorSource { get; }
        IEventListenerFactory[] EventListenerFactories { get; set; }
    }   

}
